package com.zbf.JaMiJieMi;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author: LCG
 * @date: 2023-02-10 17:12:32
 * @description:
 **/
public class EncryptFilter implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequest req = (HttpServletRequest) servletRequest;
        HttpServletResponse resp = (HttpServletResponse) servletResponse;
        AdviceHttpServletRequestWapper httpServletRequestWapper=new AdviceHttpServletRequestWapper(req);
        AdviceHttpServletReponseWapper httpServletReponseWapper=new AdviceHttpServletReponseWapper(resp);
        filterChain.doFilter(httpServletRequestWapper,httpServletReponseWapper);
    }
}
